package cn.itcast.javaobject;

/**
 * @title: OverLoadExercise
 * @Author Zhou
 * @Date: 2022/1/4 14:33
 * @Version 1.0
 */
public class OverLoadExercise {
    public static void main(String[] args) {
        Methods methods = new Methods();
        methods.m(10);
        methods.m(12, 13);
    }
}

class Methods {
    //方法名m
    //形参（int)
    public void m(int n) {
        System.out.println("平方= " + (n * n));
    }

    public void m(int n1, int n2) {
        System.out.println("相乘=" + (n1 * n2));
    }


}
